from playwright.sync_api import Playwright,sync_playwright
from time import sleep


def run(playwright: Playwright) ->None:
    browser = playwright.chromium.launch(headless=False)
    context = browser.new_context()
    page = context.new_page()

    page.goto('http://10.59.9.14:7003/')

    page.locator('xpath=/html/body/div[1]/div/div[2]/ul/li[1]/a').click()
    sleep(3)
    page.locator('[name="username"]').fill('13811033962')
    page.locator('[name="password"]').fill('123456')
    sleep(10)
    page.locator('.finish-btn').click()
    sleep(5)
    context.close()
    browser.close()

with sync_playwright() as p:
    run(p)

